package draw;

import growTree.GrowSimulation;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JPanel;


import tree.Simulation;
import tree.Tree;

public class GrowDrawPanel extends JPanel implements Observer{

	private GrowSimulation sim;
	public boolean drawDebug = false;
	public GrowDrawPanel(GrowSimulation sim){
		this.sim = sim;
	}
	
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		g.setColor(Color.white);
		g.fillRect(0,0,1000,1000);
		sim.getTree().render(g);
		g.setColor(Color.red);
		//g.drawLine(0, 700, 800,700);
		//Road.drawTaperedLine(400,600,400,200,500,100, g);	
	}
	
	@Override
	public void update(Observable arg0, Object arg1) {
		// TODO Auto-generated method stub
	repaint();
	}
}
